<?php


namespace App\Http\Controllers;


use App\Services\TeamGoalService;
use App\Transformer\TeamGoalsTransformer;
use Dingo\Api\Http\Request;

class TeamGoalsController extends Controller
{

    /**
     * 目标列表
     * @param Request $request
     * @return \Dingo\Api\Http\Response
     * @author thanatos thanatos915@163.com
     */
    public function search(Request $request)
    {
        return $this->response->paginator(TeamGoalService::search($request), new TeamGoalsTransformer());
    }

    /**
     * 批量创建目标
     * @param Request $request
     * @return \Dingo\Api\Http\Response
     * @author thanatos thanatos915@163.com
     */
    public function batchCreate(Request $request)
    {
        TeamGoalService::batchCreate($request);
        return $this->response->noContent();
    }
}
